package com.bootdo.system.service;

import java.util.List;
import java.util.Map;
import java.util.TreeMap;

import com.bootdo.system.dto.CzParm;
import com.bootdo.system.dto.GmspDto;
import com.bootdo.system.dto.Order2GoodsDto;
import com.bootdo.system.dto.OrderDto;
import com.bootdo.system.dto.ProductDto;
import com.bootdo.system.dto.ResultDto;
import com.bootdo.system.dto.SjxxDto;

public interface KswService {
	
	//商品信息
	ProductDto getSpxx(int product_id,String key,TreeMap<String, String> treeMap);
	
	//商品充值参数
	CzParm getCzParm(int product_id,String key,TreeMap<String, String> treeMap);
	
	/**
	 * 购买商品
	 * @return
	 *  product_id 	int 	true 	商品编号
		recharge_account 	string 	false 	充值账号
		recharge_template_input_items[*] 	string 	false 	模板充值参数（[1]见下方说明）
		quantity 	int 	true 	购买数量
	 */
	GmspDto getGmspDto(int product_id,String recharge_account,int quantity,String key,TreeMap<String, String> treeMap);
	
	//订单信息
	OrderDto getOrderDto(Integer order_id,String key,TreeMap<String, String> treeMap);
	
	//商家信息（查询余额）
	SjxxDto getSjxxDto(int customer_id,String key,TreeMap<String, String> treeMap);
	
	//获取接口商品订单
	Order2GoodsDto getOrder2GoodsDto(int customer_id,String key,TreeMap<String, String> treeMap);
	
	/**
	 * 处理接口商品订单
	 * order_id 	bigint 	true 	订单号
	   action 	string 	true 	操作类型（update_progress：更新充值信息，set_success：处理成功，cancel：取消订单）
	   progress_init 	int 	false 	充值进度：初始值
	   progress_now 	int 	false 	充值进度：现在值
	   progress_target 	int 	false 	充值进度：目标值
	   recharge_info 	string 	false 	返回信息
	   cards 	json 	false 	卡密 [{"no":"101","password":"00000"},{"no":"102","password":"00000"}]
	 * @return
	 */
	ResultDto doOrder(Integer order_id,String action,int progress_init,int progress_now,int progress_target,String recharge_info,String cards,String key,TreeMap<String, String> treeMap);
	
	/**
	 * 批量处理接口商品订单
	 * [
		    {
		        "order_id": "1002155",
		        "action": "update_progress",
		        "progress_init": "1",
		        "progress_now": "50",
		        "progress_target": "100",
		        "recharge_info": "返回信息"
		    },
		    {
		        "order_id": "1002156",
		        "action": "set_success"
		    },
		    {
		        "order_id": "1002157",
		        "action": "set_success",
		        "cards": "[{\"no\":\"101\",\"password\":\"00000\"},{\"no\":\"102\",\"password\":\"00000\"}]"
		    },
		    {
		        "order_id": "1002158",
		        "action": "cancel"
		    }
		]
	 * @return
	 */
	ResultDto batchDoOrder(List<Map<String,Object>> data,String key,TreeMap<String, String> treeMap);
	
	//订单退款  order_id 	int 	true 	订单号 refund_amount 	decimal 	true 	退款金额
	ResultDto doOrder2tk(int order_id,double refund_amount,String key,TreeMap<String, String> treeMap);
	
	
	/**修改商品价格
	 * product_id 	int 	true 	商品编号
	cost 	decimal 	false 	成本（如不填，将维持原成本不变）
	price 	decimal 	true 	价格
	 * @return
	 */
	ResultDto editGoodsPrice(int product_id,double cost,double price,String key,TreeMap<String, String> treeMap);
	/**
	 * 修改商品供货状态
	 * @param product_id 商品编号
	 * @param supply_state 供货状态（1：上架，2：维护，3：下架）
	 * @param maintenance_info 维护信息
	 * @return
	 */
	ResultDto editGhsStatus(int product_id,int supply_state,String maintenance_info,String key,TreeMap<String, String> treeMap);
	
}
